<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>{{ user.name }}的订单列表</title>
    <style>
        /* 基础样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Microsoft YaHei", Arial, sans-serif;
        }
        body {
            background-color: #f5f5f5;
            padding: 20px;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
        }
        .page-title {
            font-size: 24px;
            color: #333;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #eee;
        }
        /* 订单卡片样式 */
        .order-card {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            padding: 15px;
            margin-bottom: 20px;
        }
        .order-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px dashed #eee;
        }
        .order-number {
            font-size: 16px;
            color: #333;
            font-weight: 600;
        }
        .order-time {
            font-size: 14px;
            color: #666;
        }
        .order-store {
            font-size: 14px;
            color: #666;
            margin-bottom: 10px;
        }
        .order-products {
            margin-bottom: 15px;
        }
        .product-item {
            font-size: 14px;
            color: #333;
            margin-bottom: 5px;
        }
        .order-total {
            font-size: 16px;
            color: #e63946;
            font-weight: 600;
            margin-bottom: 15px;
        }
        .view-detail-btn {
            display: inline-block;
            padding: 8px 16px;
            background-color: #4CAF50;
            color: white;
            text-decoration: none;
            border-radius: 4px;
            font-size: 14px;
            transition: background-color 0.2s;
        }
        .view-detail-btn:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 class="page-title">{{ user.name }}的订单列表</h1>
        
        {% if order_list %}
            {% for order in order_list %}
                <div class="order-card">
                    <div class="order-header">
                        <div class="order-number">订单编号：{{ order.order_number }}</div>
                        <div class="order-time">{{ order.order_time }}</div>
                    </div>
                    <div class="order-store">店铺：{{ order.store_name }}</div>
                    <div class="order-products">
                        <strong>购买商品：</strong>
                        {% for product in order.products %}
                            <div class="product-item">{{ product.name }} × {{ product.quantity }}</div>
                        {% endfor %}
                    </div>
                    <div class="order-total">订单总价：¥{{ order.total_price }}</div>
                    <a href="/order/{{ order.order_id }}" class="view-detail-btn">查看订单详情</a>
                </div>
            {% endfor %}
        {% else %}
            <div class="no-orders">该用户暂无订单</div>
        {% endif %}
    </div>
</body>
</html>